import { createRouter, createWebHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'
import HomeView from '@/views/home/index.vue'
import RouterLayout from '@/layout/master/RouterLayout.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    meta: { footer: false },
  },
  {
    path: '/pullList',
    name: 'pullList',
    component: () => import('@/views/pullList/index.vue')
  },
  {
    path: '/',
    component: RouterLayout,
    children: [
      {
        path: '/index',
        redirect: '/'
      },
      {
        path: '/login',
        meta: { footer: false, menuId: 'login' },
        component: () => import('@/views/login/Login.vue')
      },
      {
        path: '/case',
        meta: { menuId: 'case' },
        component: () => import('@/views/content/case/index.vue')
      },
      {
        path: '/ability',
        meta: { menuId: 'ability' },
        component: () => import('@/views/content/ability/index.vue')
      },
      {
        path: '/ability/:id',
        meta: { menuId: 'ability' },
        component: () => import('@/views/content/ability/detail.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router
